package com.tinem.platform.service.link.api;

import com.alibaba.fastjson.JSONObject;
import com.tinem.platform.module.pojo.vo.error.UserException;
import com.tinem.platform.module.starter.sdk.MessageCode;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @className LinkApi
 * @description TODO
 * @site 
 * @company 
 * @create 2020-07-08 20:16
 */
@RestController
@RequestMapping("/test")
public class TestApi {

    @PostMapping("e.api")
    @ResponseBody
    public Object e() {
        return "";
    }
    @PostMapping("null.api")
    @ResponseBody
    public Object nullf() {
        return null;
    }
    @PostMapping("ex.api")
    @ResponseBody
    public Object ex() {
        throw new UserException(MessageCode.ERROR_COMMONS_UNKNOWN);
    }
    @PostMapping("s.api")
    @ResponseBody
    public Object s() {
        return "string";
    }

    @PostMapping("o.api")
    @ResponseBody
    public Object o() {
        JSONObject o = new JSONObject();
        o.put("aa","bb");
        return o;
    }

}
